home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Source / Resound / FileController.h < prev    next >
Encoding:
Text File  |  1992-06-13  |  3.5 KB  |  139 lines

  1.  
  2. /*     
  3.  
  4.     File Controller
  5.     April 2
  6.     
  7.     The File Controller is the central object.  Its function is to manage the
  8.     loading and memory storage of all sounds, soundviews, and soundview 
  9.     windows.  All File menu items go directly to it.  The round-robin quitting
  10.     and save all systems are managed by it.  Finally, EVERYTHING MUST go
  11.     through the File Controller to get information on any sound.
  12.     
  13.     The File Controller uses the Sound Table, which no one else is allowed
  14.     to touch, on pain of death.  The Sound Table stores sound, soundview, and
  15.     window IDs, and X/Y coordinates for new windows.
  16.     
  17. */
  18.  
  19. #import <objc/Object.h>
  20.  
  21. @interface FileController:Object
  22. {
  23.     id    TheSoundTable;
  24.     id  TheInfoManager;
  25.     id  TheEditController;
  26.     id  TheModuleController;
  27.     id  TheSoundManager;
  28.     id     ThePreferencesManager;
  29.     
  30.     id  Console;
  31.     id  ClosePanel;
  32.     id  QuitPanel;
  33.     id  CurrentPanel;
  34.     id  NoDataSavePanel;
  35.     id  SaveButton;
  36.     id  SaveAsButton;
  37.     id  SaveAllButton;
  38.     id  RevertButton;
  39.     id  CloseButton;
  40.     
  41.     
  42.     BOOL Quitting;                        // Program is quitting
  43.     BOOL PanelCancelled;                // A panel has cancelled
  44.     BOOL DoClose;                        // User wants program to close window
  45.     BOOL DoQuit;                        // User wants program to quit
  46. }
  47.  
  48. - init;
  49. - New:sender;                            //     creates a new sound.
  50.                                             /* This entails a lot.  The program
  51.                                                creates and manages a new sound,
  52.                                                soundview, window, and sets
  53.                                                delegates of the soundview,
  54.                                                window, and sound to itself, the
  55.                                                editcontroller and the 
  56.                                                soundcontroller.*/
  57.                                     
  58. - NewRecordedSound: ThisSound;                            
  59. - Open:sender;                            //     opens sounds. Similar to New.
  60. - Close:sender;                            //     closes sounds.  Goes through save 
  61.                                         //    process.
  62.  
  63. - SaveAll:sender;                        // initiates save all process.
  64. - SaveAs:sender;                        // etc.
  65. - Save:sender;
  66. - Revert:sender;
  67.  
  68.                                         /* Empty Sounds cannot be saved */
  69.  
  70. - Quit:sender;
  71. - Print:sender;
  72. - DoPageLayout:sender;
  73.  
  74. - SoundChanged:ThisSound;                // sets sound edited flags in
  75.                                         //    sound table, and sets the window
  76.                                         //    close box to a broken X.
  77.  
  78.                                         
  79.                                         
  80.                                         
  81.                                         
  82.                                         //     The following are very useful.
  83.                                         //    They return ids to the current
  84.                                         //    window, sound, or soundview.
  85.  
  86.  
  87. - CurrentWindow:sender;                    /*returns NULL if no Current*/
  88. - CurrentSound:sender;                    // ditto
  89. - CurrentSoundView:sender;                // ditto
  90.  
  91.  
  92.  
  93. /*  The following methods are used internally.   
  94.     On pain of death, Do not call them.                            */
  95.  
  96. - (BOOL) Save;
  97. - (BOOL) SaveAs;
  98. - SaveBeforeQuit:sender;
  99. - DontSaveBeforeQuit:sender;
  100. - CancelSaveBeforeQuit:sender;
  101.  
  102. - SaveBeforeClose:sender;
  103. - DontSaveBeforeClose:sender;
  104. - CancelSaveBeforeClose:sender;
  105.  
  106. - TurnOnMenu:sender;
  107. - TurnOffMenu:sender;
  108. - TurnOffInformation:sender;
  109. - TurnOnInformation:sender;
  110. - CheckInformation:sender;
  111.  
  112. - NoDataSaveOkay:sender;
  113.  
  114. /*  The following method is implemented by FileController
  115.     as a delegate of SavePanel and OpenPanel.  Do not call it.     */
  116.     
  117. - (BOOL) panelValidateFilenames:sender;
  118.  
  119.  
  120.  
  121. /*  The following methods are implemented by FileController
  122.     as a window delegate.  Do not call them.                       */
  123.     
  124. - windowDidResize:sender;
  125. - windowDidBecomeKey:sender;
  126. - windowDidBecomeMain:sender;
  127. - windowWillClose:sender;
  128. - WindowDidUpdate:sender;
  129. - WindowDidResize:sender;
  130.  
  131. /*    The following methods are implemented by FileController
  132.     as a delegate of Application.  Do not call them.                */
  133.     
  134. - appDidBecomeActive:sender;
  135. - appDidUnhide:sender;
  136. - appDidUpdate:sender;
  137.  
  138. @end
  139.